package com.ruoyi.business.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ConsultMapper;
import com.ruoyi.business.domain.Consult;
import com.ruoyi.business.service.IConsultService;

/**
 * 咨询回复Service业务层处理
 * 
 * @author liwenjing
 * @date 2021-05-16
 */
@Service
public class ConsultServiceImpl implements IConsultService 
{
    @Autowired
    private ConsultMapper consultMapper;

    /**
     * 查询咨询回复
     * 
     * @param id 咨询回复ID
     * @return 咨询回复
     */
    @Override
    public Consult selectConsultById(Long id)
    {
        return consultMapper.selectConsultById(id);
    }

    /**
     * 查询咨询回复列表
     * 
     * @param consult 咨询回复
     * @return 咨询回复
     */
    @Override
    public List<Consult> selectConsultList(Consult consult)
    {
        return consultMapper.selectConsultList(consult);
    }

    /**
     * 新增咨询回复
     * 
     * @param consult 咨询回复
     * @return 结果
     */
    @Override
    public int insertConsult(Consult consult)
    {
        consult.setCreateBy(SecurityUtils.getUsername());
        return consultMapper.insertConsult(consult);
    }

    /**
     * 修改咨询回复
     * 
     * @param consult 咨询回复
     * @return 结果
     */
    @Override
    public int updateConsult(Consult consult)
    {
        return consultMapper.updateConsult(consult);
    }

    /**
     * 批量删除咨询回复
     * 
     * @param ids 需要删除的咨询回复ID
     * @return 结果
     */
    @Override
    public int deleteConsultByIds(Long[] ids)
    {
        return consultMapper.deleteConsultByIds(ids);
    }

    /**
     * 删除咨询回复信息
     * 
     * @param id 咨询回复ID
     * @return 结果
     */
    @Override
    public int deleteConsultById(Long id)
    {
        return consultMapper.deleteConsultById(id);
    }

    @Override
    public Integer getUndo(Consult consult) {
        return consultMapper.getUndo(consult);
    }
}
